package com.learn.other.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/03/28
 * @description 返回类型的枚举类
 *  不知为什么@Setter不能加在枚举类上
 */

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum CodeEnum {

    OK(200, "成功"),
    FAIL(400, "失败"),
    BAD_REQUEST(400, "请求错误"),
    NOT_FOUND(404, "未找到资源"),
    INTERNAL_ERROR(500, "内部服务器错误"),
    MODIFICATION_FAILED(400, "修改失败"),
    DELETION_FAILED(400, "删除失败"),
    CREATION_FAILED(400, "创建失败");

    @Setter
    private int code;
    @Setter
    private String msg;
}
